<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

</body>
</html>

<!-- <script type="text/javascript">
	function print_world(num){//num为形参
		for (var i =1; i<=num;i++){
			document.write("hello,world"+"<br/>")
		}
	}
	print_world(5)//5为实参
</script> -->

<!-- <script type="text/javascript">
	function add(num1,num2) {

		return num1+num2；//函数调用的结果是表达式的值，在return之后函数就结束，不再运行下面
	}

	document.write(add(2,3))

</script> -->

<script type="text/javascript">
	function test(num1,operater,num2) {
		if(operater=="+"){
			return num1+num2;
		}else if(operater=="-"){

			return num1-num2;
		}else if(operater=="*"){
			return num1*num2
		}else if(operater="/"){
			return num1/num2
		}else{
			document.write(error)
		}
	}


	document.write(test(100,"/"5))
</script>

<script type="text/javascript">
	function test2(num1,operater,num2) {
		switch(operater){
			case "+":
			return num1+num2;
			case "-":
			return num1-num2;
			case "*":
			return num1*num2;
			case "/":
			return num1/num2;
			default:
			break;
		}
	}
	document.write(test2(3,"+",2))
</script>